$(function(){
    var markers = [],
    a = {
        csme: {
            latLng: [48.954400,2.314410],
            data: '<div class="tooltip-map" align="left" style="font-size:12px; color:#999; margin-bottom:0px; height:120px;"><img style=" margin-bottom:5px;" src="images/logo_map.png" width="80" height="38" /><br><b style="color:#006699; padding:0px;">' + "Club Sportif Multi Sections d'Epinay-sur-Seine"+'</b><br><b style="font-weight:normal; font-family:arial,helvetica; padding:0px;">6, av. de Lattre de Tassigny</b><br><b style="font-weight:normal; font-family:arial,helvetica; padding:0px;">Epinay-sur-Seine - 93800</b></div>',
            icon: getMarkerImage('markers/image01.png',36,53),
            shadow: getMarkerImage('markers/shadow.png',66,53)
        },
        epinay: {
            latLng: [48.951600,2.313300],
            data: '<div class="tooltip-map" align="left" style="font-size:12px; color:#999; margin-bottom:0px;"><img style=" margin-bottom:5px;" src="images/logo_epinay_map.jpg" /><br><b style="color:#006699; padding:0px;">' + "Mairie Epinay-sur-Seine"+'</b><br><b style="font-weight:normal; font-family:arial,helvetica; padding:0px;">1-3 rue Qu&eacute;tigny<br><bstyle="font-weight:normal; font-family:arial,helvetica; padding:0px;"> Epinay-sur-Seine - 93800</b>',
            icon: getMarkerImage('markers/image02.png',36,53),
            shadow: getMarkerImage('markers/shadow.png',66,53)
        }
    },
    map = $('#map').gmap3({
        action: 'init',
        options: {
            center: [46.578498,2.457275],
            zoom: 6
        }
    });
        
    addCloseMarker(map, a.epinay.latLng[0], a.epinay.latLng[1], a.epinay.data, a.epinay.icon, a.epinay.shadow);
    addOpenMarker(map, a.csme.latLng[0],a.csme.latLng[1], a.csme.data, a.csme.icon, a.csme.shadow);

    markers = map.gmap3({
        action:'get', 
        name:'marker', 
        all:true
    });
    
    $('#map-1,#map-2').click(function(){
        google.maps.event.trigger(markers[$(this).is('#map-1') ? 1 : 0], 'click');
    });
});